# coding:utf-8
from numpy.core.numeric import array
import unittest
from minPhase import MinPhase

class minPhaseTest(unittest.TestCase):
    def setUp(self):
        ir = array([1, 1, 1, 1])
        fs = 8000
        self.obj = MinPhase(ir, fs)
    def tearDown(self):
        pass
    def testCalcCamp(self):
        assert (self.obj.calcCamp() == array([0.34657359027997264+0j, 0.34657359027997264+0j, 0.34657359027997264+0j, 0.34657359027997264+0j])).all()
    def testGenWin(self):
        assert (self.obj.genWin(4) == array([1, 2, 1, 0])).all()

unittest.main()
